@import './config.scss';
@import './mixins.scss';

.theme__dark .franz-form {
  .franz-form__label {
    color: $dark-theme-text-color;
  }

  .franz-form__input-wrapper {
    background: $dark-theme-gray-dark;
    border: 1px solid $dark-theme-gray-light;
  }

  .franz-form__input {
    color: $dark-theme-gray-lightest;

    &::placeholder {
      color: $dark-theme-gray-lighter;
    }
  }

  .franz-form__input-prefix,
  .franz-form__input-suffix {
    background: $dark-theme-gray;
    color: $dark-theme-gray-lighter;
  }

  .franz-form__input-modifier {
    border-left: 1px solid $dark-theme-gray-light;
    color: $dark-theme-gray-lighter;
  }

  .franz-form__password-score {
    background: $dark-theme-gray-dark;
  }
}

.franz-form {
  .franz-form__field {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin-bottom: 20px;

    &.has-error {
      .franz-form__input-wrapper,
      .franz-form__input-modifier {
        border-color: $theme-brand-danger;
      }
    }
  }

  .franz-form__label {
    @include formLabel();
  }

  .franz-form__error {
    color: $theme-brand-danger;
    margin-top: 10px;
    order: 2;
  }

  .franz-form__input-wrapper {
    background: $theme-gray-lightest;
    border: 1px solid $theme-gray-lighter;
    border-radius: $theme-border-radius-small;
    display: flex;
    flex-wrap: wrap;
    order: 1;
    width: 100%;
  }

  .franz-form__input {
    background: none;
    border: 0;
    color: $theme-gray;
    flex: 1;
    padding: 8px;
    width: 100%;

    &::placeholder {
      color: lighten($theme-gray-light, 10%);
    }
  }

  .franz-form__input-prefix,
  .franz-form__input-suffix {
    background: $theme-gray-lighter;
    color: $theme-gray-light;
    line-height: 35px;
    padding: 0 10px;
  }

  .franz-form__input-modifier {
    border-left: 1px solid $theme-gray-lighter;
    color: $theme-gray-light;
    font-size: 20px;
    padding: 0 20px;
  }

  .franz-form__password-score {
    background: $theme-gray-lighter;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    flex-basis: 100%;
    height: 5px;

    meter {
      border-bottom-left-radius: 3px;
      border-bottom-right-radius: 3px;
      display: block;
      height: 100%;
      overflow: hidden;
      width: 100%;

      &::-webkit-meter-bar {
        background: none;
      }
      &::-webkit-meter-even-less-good-value {
        background: $theme-brand-danger;
      }
      &::-webkit-meter-suboptimum-value {
        background: $theme-brand-warning;
      }
      &::-webkit-meter-optimum-value {
        background: $theme-brand-success;
      }
    }
  }
}
